﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Model;
using ExpenseSystem.Lor;
using ExpenseSystem.Common;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Core.DataAddOn;

namespace ExpenseSystem.Core.PayModules
{
    public class PayBaseManager:PayManager
    {
        PayFetcher fetcher = new PayFetcher();
        public override bool Delete(PayModel Pay,  out string message)
        {
            if (Pay.Site != profile.SiteId)
            {
                message = "当前登录的组织与档案所在组织不一致";
                return false;
            }
            bool result = PayUpdater.Remove(Pay, tran, fetcher, out message);
            return result;
        }

        public override bool DeleteById( long[] PayIds,  out string message)
        {
            bool result = true;
            result = PayUpdater.RemoveById( profile.SiteId, PayIds, tran, fetcher, out message);
            return result;
        }

        public override bool Save( PayModel Pay, out string message, params IAddable<PayModel>[] addable)
        {
            if (Pay.Site != profile.SiteId)
            {
                message = "当前登录的组织与档案所在组织不一致";
                return false;
            }
            bool result = true;
            result = PayUpdater.Save( Pay, tran, fetcher, out message);
            return result;
        }
    }
}
